//
// Created by lz on 2/27/21.
//

#ifndef MYWEBLIB_NET_TIMERID_H
#define MYWEBLIB_NET_TIMERID_H
#include "base/copyable.h"

namespace lzweb
{
namespace net
{
class Timer;

class TimerId: public copyable
{
public:

	TimerId()
		: timer_(nullptr),
		  sequence_(0)
	{}

	TimerId(Timer *timer, int64_t seq)
		: timer_(timer),
		  sequence_(seq)
	{}

	// default copy-ctor, dtor and assignment are okay

	friend class TimerQueue;
private:
	Timer *timer_;
	int64_t sequence_;  // 标记第几个创建的timer
};

}//namespace net
}//namespace lzweb


#endif //MYWEBLIB_NET_TIMERID_H
